<?php
    class ShopDomain extends CActiveRecord
    {
        public static function model($className = __CLASS__) {
            return parent::model ( $className );
        }

        public function tableName() {                  
            return 'c_shop_domain';
        }

        /* Lấy danh sach domain */
        public function getDomainByUserId($UserId)
        {
            $sql = "SELECT  id,user_id, user_name, domain,date_create FROM c_shop_domain WHERE user_id= $UserId  ORDER BY id DESC ";
            $command = Yii::app()->db->createCommand($sql);
            $rows = $command->queryAll();
            return $rows;
        }
    }
?>
